Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stratis support v2 #952

Conversation

vojtechtrefny
Copy link
Member

@vojtechtrefny vojtechtrefny commented Apr 23, 2021

New version of #915 I made some smaller changes in the code, the biggest difference are names of the Stratis devices, I've removed the underscore in stratis pool and stratis filesystem to make it more consistent with our other names. This now includes support for both "normal" and encrypted pools.

I've also moved this to 3.5-devel to make 3.4.0 release a little bit smaller and to have more time for testing and review here.

You can use blivet-gui for testing (everything except devicefactory support), I have a PR with experimental Stratis support here storaged-project/blivet-gui#277

@vojtechtrefny vojtechtrefny changed the base branch from 3.4-devel to 3.5-devel April 23, 2021 13:40
@vojtechtrefny vojtechtrefny force-pushed the 3.5-devel_stratis-support-v2 branch 4 times, most recently from 5cf7ec4 to 89d6c7b Compare May 14, 2021 12:31
Copy link
Contributor

@dwlehman dwlehman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Other than the inline comments, it does make me wonder if a LUKSMixin class would be worthwhile (to enable sharing the existing LUKS format code between formats and devices).

blivet/blivet.py Show resolved Hide resolved
space += sum(p.size for p in self.pool.parents)
log.debug("size bumped to %s to include Stratis pool parents", space)

space += self._get_free_disk_space()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could move this down as the implementation of _get_device_space? It's a strange case for sure. One way or another it would be good to remove the FIXME from _get_device_space, even if the implementation stays as it is now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. The FIXME from _get_device_space actually refers to missing support for checking used space in pools, I was waiting for a new stratis API for this and forgot to implement free space and metadata usage in pools and filesystems. This needs to be added to both devicefactory and devices/stratis.

blivet/devicefactory.py Show resolved Hide resolved
blivet/devices/stratis.py Outdated Show resolved Hide resolved
blivet/devices/stratis.py Show resolved Hide resolved
blivet/devices/stratis.py Outdated Show resolved Hide resolved
blivet/populator/helpers/stratis.py Outdated Show resolved Hide resolved
@vojtechtrefny vojtechtrefny force-pushed the 3.5-devel_stratis-support-v2 branch from 89d6c7b to 2141619 Compare July 13, 2021 14:31
Currently only Stratis private devices are being ignored.
New StratisBlockdev format and two new devices StratisPoolDevice
and StratisFilesystemDevice has been added. Stratis devices are
populated using data from Stratis DBus API (cached in
static_data.stratis_info).
We are ignoring a lot of stratis private device mapper devices now
so we can no longer use libblockdev DM plugin to remove Stratis
storage stack and we need to use Stratis DBus API instead.
devicelibs.stratis uses stratis_info so we can't import constants
from it here without breaking Python.
This will allow us handling the XFS filesystem on Stratis in a
better way to avoid creating and removing it separately (it should
be created and removed automatically together with the Stratis
filesystem block device).
Locked pools are tricky because Stratis uses LUKS but the "Stratis
LUKS devices" can't be unlocked with cryptsetup, only with Stratis
API. This implementation "hides" the LUKS device for locked pools
and use the StratisBlockdev format for them instead. To unlock
a locked pool, unlock_pool() function of the StratisBlockdev format
must be used.
The internal private dm-crypt device is created and destroyed
together with the pool so having it in the tree would make things
even more complicated.
@vojtechtrefny vojtechtrefny force-pushed the 3.5-devel_stratis-support-v2 branch from 2141619 to f3bbdd7 Compare September 1, 2021 10:52
When creating a new filesystem we need to check whether the pool
has enough free space for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants